package hmis.pos.Entity;

import hmis.pos.Base.BaseEntity.BaseEntity;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name="checkin")
public class CheckIn extends BaseEntity {

    //房间号
    @Column(name = "roomid",nullable = false)
    private int roomid;

    //订单明细号
    @Column(name = "orderdetail_id",nullable = false)
    private String orderdetail_id;

    //一个订单明细可以对应多个入住信息
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name="orderdetail_id",referencedColumnName = "id",insertable = false,updatable = false)
    private OrderDetail orderDetail;

    //房间入住时间
    @Column(name = "in_time")
    private Date in_time;

    //退房时间
    @Column(name = "out_time")
    private Date out_time;

    public int getRoomid() {
        return roomid;
    }

    public void setRoomid(int roomid) {
        this.roomid = roomid;
    }

    public String getOrderdetail_id() {
        return orderdetail_id;
    }

    public void setOrderdetail_id(String orderdetail_id) {
        this.orderdetail_id = orderdetail_id;
    }

    public OrderDetail getOrderDetail() {
        return orderDetail;
    }

    public void setOrderDetail(OrderDetail orderDetail) {
        this.orderDetail = orderDetail;
    }

    public Date getIn_time() {
        return in_time;
    }

    public void setIn_time(Date in_time) {
        this.in_time = in_time;
    }

    public Date getOut_time() {
        return out_time;
    }

    public void setOut_time(Date out_time) {
        this.out_time = out_time;
    }

    @Override
    public String toString() {
        return "CheckIn{" +
                "roomid=" + roomid +
                ", orderdetail_id='" + orderdetail_id + '\'' +
                ", orderDetail=" + orderDetail +
                ", in_time=" + in_time +
                ", out_time=" + out_time +
                '}';
    }
}
